package com.qunar.wan.email;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * User: tongjie.yang Date: 13-11-29 Time: 下午3:14
 */
public class SendMessage {
    private List<String> tos;
    private String subject;
    private String imgName;
    private File file;
    private String form;
    private List<String> texts = new ArrayList<String>();
    private List<SendMessage> images = new ArrayList<SendMessage>(); // 可以设置多张图片

    public SendMessage() {
    }

    public SendMessage(String imgName, File file) {
        super();
        this.imgName = imgName;
        this.file = file;
    }

    public void addFile(String imgName, File file) {
        images.add(new SendMessage(imgName, file));
    }

    public void addText(String text) {
        texts.add(text);
    }

    public List<SendMessage> getImages() {
        return images;
    }

    public void setImages(List<SendMessage> images) {
        this.images = images;
    }

    public String getForm() {
        return form;
    }

    public void setForm(String form) {
        this.form = form;
    }

    public String getImgName() {
        return imgName;
    }

    public void setImgName(String imgName) {
        this.imgName = imgName;
    }

    public List<String> getTos() {
        return tos;
    }

    public void setTos(List<String> tos) {
        this.tos = tos;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getSendTexts() {
        StringBuilder sbr = new StringBuilder();
        List<String> texts = getTexts();
        for (String text : texts) {
            sbr.append(text);
        }
        return sbr.toString();
    }

    public File getFile() {
        return file;
    }

    public void setFile(File file) {
        this.file = file;
    }

    public List<String> getTexts() {
        return texts;
    }

    public void setTexts(List<String> texts) {
        this.texts = texts;
    }
}
